﻿using Genius.Brain.Shared.Strategy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Genius.Brain.Impl.Strategy
{
    class LanguageConstructorStrategyForEn : ILanguageConstructorStrategy
    {
        public string Concat(string[] words)
        {
            var builder = new StringBuilder();
            for(var i = 0;i < words.Length;i++)
            {
                if (i == 0)
                    builder.Append(words[i]);
                else if (i + 1 == words.Length)
                    builder.AppendFormat(" and {0}", words[i]);
                else
                    builder.AppendFormat(", {0}", words[i]);
            }
            return builder.ToString();
        }
    }
}
